(in-package :gen-res)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; list of suitable (types of) subjects:
(defparameter *the-subject-list* 
  (list 
   'generic-resource
   
   'mile-stone 
   'slip 
   'action-item
   'agenda-item
        
   'actor 
   'stakeholder
   'pokemon 
   
   
   'meeting 
   'review
   'gate 
   
   'project
   'product
   'configuration-item
   'subsystem
   'feature
   'defect 
        
   'project-phase 
   'product-release
        
   'document
   'feasibility-assessment
   'business-case
   'plan
   'reference
   'checklist
   'checklist-item
        
   'risk 
   'knowledge-gap
   'constraint
   'requirement
   'lesson-learned
   'ctq
   'reference
        ) )


(defparameter *the-property-list*
  (list 'id 
        'name 
        'owner 
        'date ; date is deprecated in favor of creation-date
        'creation-date
        'target-date
        'completion-date
        'comment 
        'priority 
        'feature-priority
        'line-item 
        'predecessor 
        'applies-to
        'new-date
        'link
        'supports
        'component-of
        'does-not-support
        'phone-number 
        'visibility 
        'likelihood 
        'severity 
        'criticality 
        'drama-index 
        'rpn 
        'value
        'version
        'release
        'index
        'branches-to
        'merges-to
        'concurrent-with
        'deadline
        'recurrence 
        'employer
        'done
        'rationale
        'from
        'completion
        'to-be-discussed-in
        'applies-to-feature
        'applies-to-subsystem
        'applies-to-project
        'applies-to-product
        'applies-to-agenda-item
        'applies-to-risk
        'applies-to-configuration-item
        'attendee
        'duplicate-defect
        'mitigation
        'contingency
        'description
        'is-a
        ) )


; rdfs:subPropertyOf
(defparameter *the-subproperty-list*
  (list 
   (list 'applies-to-feature 'applies-to)
   (list 'applies-to-subsystem 'applies-to)
   (list 'applies-to-project 'applies-to)
   (list 'applies-to-product 'applies-to)
   (list 'applies-to-agenda-item 'applies-to)
   (list 'applies-to-risk 'applies-to)
   (list 'applies-to-configuration-item 'applies-to)
   (list 'creation-date 'date)
   (list 'target-date 'date)
   (list 'completion-date 'date)
   )  )


(defparameter *the-subclass-list*
  (list 
   (list 'product-release 'mile-stone)
   (list 'gate 'mile-stone)
   (list 'branches-to 'predecessor)
   (list 'merges-to 'predecessor)
   (list 'concurrent-with 'predecessor)
   (list 'constraint 'requirement)
   (list 'plan 'document)
   (list 'feasibility-assessment 'document)
   (list 'business-case 'document)
   (list 'stakeholder 'actor)
   (list 'reference 'document)
   (list 'checklist 'document)
   (list 'feature 'configuration-item)
   (list 'subsystem 'configuration-item)
   (list 'document 'configuration-item)
   (list 'knowledge-gap'risk)
   )  )

(defparameter *range-and-domain*
  (list
   (list 'actor 'employer 'actor)
   (list 'agenda-item 'to-be-discussed-in 'meeting)
   (list nil 'owner 'actor)
   (list 'action-item 'from 'meeting)
   (list 'action-item 'deadline 'mile-stone)
   (list 'mile-stone 'predecessor 'mile-stone)
   (list 'meeting 'recurrance nil)
   (list 'action-item 'priority nil)
   (list 'risk 'severity nil)
   (list 'risk 'criticality nil)
   (list 'slip 'new-date nil)
   (list 'mile-stone 'line-item nil)
   (list 'feature 'feature-priority nil)
   ; (list 'nil'applies-to 'mile-stone)
   (list 'nil 'applies-to-feature 'feature)
   (list nil 'applies-to-subsystem 'subsystem)
   (list nil 'applies-to-agenda-item 'agenda-item)
   (list nil 'applies-to-configuration-item 'configuration-item)
   (list 'plan 'applies-to-project 'project)
   (list 'meeting 'attendee 'actor)
   (list 'defect 'duplicate-defect 'defect)
   (list 'risk 'mitigation 'action-item)
   (list 'risk 'contingency 'action-item)
   (list 'configuration-item 'supports 'configuration-item)
   (list 'configuration-item 'does-not-support'configuration-item)
   (list 'configuration-item 'is-a 'configuration-item)
   

   ))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defmacro get-res-id (l) `(getf ,l 'id))
(defmacro get-resource-id (l)
  `(if (listp ,l)
       (let* ( (i (get-res-id ,l))) 
         (if i i 0))
     0))

(defmacro crc-id (n) `(crc-s (string (quote ,n))))

; set-res is the preferred method for creating a resource.
(defmacro set-res (x n &rest body)
  `(defparameter ,n (list 'res ,x 'id (crc-id ,n) 'name (string (quote ,n)) ,@body)))

(defmacro is-res (x n &rest body)
  `(list 'res ,x 'name ,n ,@body))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



